Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Stop passing sessionid cookie in to media uploader #29489

Merged

Conversation

dannyroberts
Copy link
Member

@dannyroberts dannyroberts commented Apr 8, 2021

it has not served a purpose in years and is a poor practice.
Also remove references to swfURL, which was removed 5 years ago.

Summary

https://dimagi-dev.atlassian.net/browse/SAAS-11746

Corresponding PRs dimagi/MediaUploader#29 and dimagi/Vellum#1004 are part of the same cleanup, but I believe each can actually be merged separately without causing errors from mismatched versions. (That's how little used the values are.)

Feature Flag

Product Description

None

Safety Assurance

  • Risk label is set correctly
  • All migrations are backwards compatible and won't block deploy
  • The set of people pinged as reviewers is appropriate for the level of risk of the change
  • If QA is part of the safety story, the "Awaiting QA" label is used
  • I have confidence that this PR will not introduce a regression for the reasons below

Automated test coverage

QA Plan

Not planning QA

Safety story

I tested (1) bulk media upload (2) case list media upload in app builder (3) question media upload in form builder, both locally and on staging. On staging this was tested without the other two related branches to make sure it's safe to deploy on its own, allowing us to later deploy the others as no-op cleanups rather than wondering whether they need to be perfectly timed.

Rollback instructions

  • This PR can be reverted after deploy with no further considerations

it has not served a purpose in years and is a poor practice.
Also remove references to swfURL, which was removed 5 years ago.
sessionid: initial_page_data('sessionid'),
}));
print_uploader.options,
);

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Parsing error: Unexpected token )

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What am I missing. Our .eslintrc.js requires comma-dangle, and Parsing error isn't what I'd expect in that situation anyway, so it can't be that. Am I like counting parentheses wrong?

Copy link
Contributor

@orangejenny orangejenny Apr 8, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

comma-dangle is for objects & arrays, but not parameter lists in function calls. This will also break deploy because the uglifier will interpret it as a syntax error.

Today I learned that the trailing comma is allowed in function calls as of ECMAScript 2017, but we're not there yet.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah, okay thank you sharing that. I assumed because of https://eslint.org/docs/rules/comma-dangle#functions that comma-dangle included function arguments. But maybe this parsing error is coming from something other than eslint 🤔

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think eslint has logic so that function arguments aren't included in the comma-dangle rule, even when it's set to "always", unless you also have an eslint environment that supports that syntax, like by setting ecmaVersion to 8+

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah okay gotcha. That was the piece I was missing. Thanks!

swfURL: initial_page_data("swfURL"),
}, uploader.options));
uploader.options,
);

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Parsing error: Unexpected token )

@dannyroberts dannyroberts added the product/invisible Change has no end-user visible impact label Apr 8, 2021
@dannyroberts dannyroberts added product/invisible Change has no end-user visible impact and removed product/invisible Change has no end-user visible impact labels Apr 8, 2021
@dannyroberts dannyroberts merged commit eeebd15 into master Apr 9, 2021
@dannyroberts dannyroberts deleted the dmr/remove-vestigial-reference-to-session-cookie branch April 9, 2021 21:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
product/invisible Change has no end-user visible impact
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants